import java.sql.SQLOutput;
import java.util.Random;
import java.util.Scanner;

public class Test {
    public static void main(String[]args){
        int sum = 123;
        System.out.println(sum%10);
        System.out.println((sum/10) %10);
        System.out.println((((sum/10)/10)%10));
    }

    public static void main12(String[]args){
        int count = 0;
        for(int i = 0;i<=100;i++){
            if(i%10==9){
                System.out.println(i);
                count++;
            }
        }
        System.out.println("出现9的个数为"+count+"个");
    }

    public static void main11(String[]args) {
        for (int i = 1000; i <= 2000; i++) {
            if ((i % 100 != 0 && i % 4 == 0 )|| (i % 100 == 0 && i % 400 == 0)) {
                System.out.println(i);
            }
        }
    }
    //乘法口诀
    public static void main10(String[]args){

            for (int i = 1; i <= 9; i++) {
                for (int j = 1; j <= i; j++) {
                    System.out.print(j+"*"+i +"="+i*j+" ");
                }
                System.out.println();
            }

        }


    //给定一个数字判断这个数字是否是奇数
    public static void main9(String[]args){
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个数字");
        int num = sc.nextInt();
        if(num%2!=0){
            System.out.println("是奇数");
        }else{
            System.out.println("不是奇数");
        }
    }

    public static void main8(String[]args){
        Random random = new Random();//系统随机生成一个数字
        Scanner sc = new Scanner(System.in);//输入一个数字
        int figures = random.nextInt(100);//生成1到100之间的随机数字
        System.out.println(figures);
        while(true){
            System.out.println("请输入一个数字（1-100）");
            int num = sc.nextInt();
            if(num > figures){
                System.out.println("猜大了！");
            }else if(num < figures){
                System.out.println("猜小了！");
            }else{
                System.out.println("恭喜你，猜对了！");
                break;
            }
        }

    }
    public static void main7(String[]args){
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入你的姓名");
        String name = sc.nextLine();
        System.out.println("请输入你的年龄");
        int age = sc.nextInt();
        System.out.println("请输入你的工资");
        double salay = sc.nextDouble();
        System.out.println("你的信息如下");
        System.out.println("姓名："+name+"\n"+"年龄："+age+"\n"+"工资："+salay);
sc.close();
    }
    public static void main5(String[]args){
        int sum = 0;
        for(int i = 1;i<=5;i++){
            int tmp = 1;
            for(int j = 1; j<=i;j++){
                tmp*=j;
            }
            sum+=tmp;
        }
        System.out.println(sum);
    }
    public static void main6(String[]args){
        int i = 1;
       // int ret = 1;
        int sum = 0;
        int j = 1;

        for(i=1;i<=5;i++){
            int ret = 1;
           for(j=1;j<=i;j++){
               ret*=j;
           }
           sum+=ret;
        }
        System.out.println(sum);
    }
    public static void main4(String[]args){
        int i = 0;
        int sum = 0;
        for(i=1;i<101;i++){
            sum+=i;
        }
        System.out.println(sum);

    }
    public static void main3(String[]args){
        //找到100到200之间3的所有倍数
        int num = 100;
        while(num<=200){
            if(num%3!=0){
                num++;
                continue;
            }
            System.out.println("找到了，3的倍数为:"  +   num);
            num++;
        }
    }
    public static void main2(String[]args){
        //找100到200中第一个3的倍数
        int num = 100;
        while(num<=200){
            if(num%3==0){
                System.out.println("找到了3的倍数为："+num);
                break;
            }
            num++;
        }
    }
    //计算1到5的阶乘
    public static void main1(String[]args){
        int a = 1;
        int b = 0;
        while(a<=5){
            int c = 1;
            int ret = 1;
            while(c<=a){
                ret*=c;
                c++;
            }
            b +=ret;
            a++;
        }
        System.out.println(b);
    }
}
